Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
22a19e9 to
6f939aa
Compare
|
@claude review this |
|
Claude finished @thibaultleouay's task in 1m 28s —— View job Code Review
|
6f939aa to
1294b04
Compare
6bd2e1d to
a06fefb
Compare
Deploying openstatus-docs with
|
| Latest commit: |
a6f090f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://18af3497.openstatus-1sy.pages.dev |
| Branch Preview URL: | https://improve-plan-update.openstatus-1sy.pages.dev |
|
@claude review this |
|
Claude finished @thibaultleouay's task in 1m 53s —— View job Code Review
SummaryThis PR improves Stripe webhook handling for plan updates and cancellations. The changes cover Fixes Since Last ReviewThe two major issues from the previous review are now resolved:
Remaining IssuesN+1 queries in downgrade loops ( Still outstanding from the last review. Each monitor and each notification is updated/deleted in a separate query inside the transaction. For workspaces with many resources this is inefficient and increases transaction lock time. // Current (N+1):
for (const m of activeMonitors.slice(1)) {
await tx.update(monitor).set({ active: false }).where(eq(monitor.id, m.id)).run();
}
// Better:
const idsToDeactivate = activeMonitors.slice(1).map((m) => m.id);
if (idsToDeactivate.length > 0) {
await tx.update(monitor).set({ active: false }).where(inArray(monitor.id, idsToDeactivate)).run();
}Same pattern applies to the notification deletion loop. Fix this →
When No event deduplication ( Stripe may deliver the same webhook event more than once. Neither handler deduplicates by
After the transaction, Positives
|

No description provided.